package cn.cvs.dao;

import cn.cvs.pojo.Supplier;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SupplierMapper {

    /**
     * 查询供应商列表
     *
     * @param pageIndex
     * @param pageSize
     * @param querySupCode
     * @param querySupName
     * @return
     * @throws Exception
     */
    List<Supplier> queryAllSupplier(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize,
                                    @Param("querySupCode") String querySupCode, @Param("querySupName") String querySupName) throws Exception;

    /**
     * 供应商数量
     *
     * @param querySupCode
     * @param querySupName
     * @return
     * @throws Exception
     */
    Integer findAllcount(@Param("querySupCode") String querySupCode, @Param("querySupName") String querySupName) throws Exception;

    /**
     * 添加供应商
     *
     * @param supplier
     * @return
     * @throws Exception
     */
    Integer addSupplier(Supplier supplier) throws Exception;

    /**
     * 通过Id查询供应商
     *
     * @param id
     * @return
     * @throws Exception
     */
    Supplier querySupplierById(@Param("id") String id) throws Exception;

    /**
     * 修改供应商信息
     *
     * @param supplier
     * @return
     * @throws Exception
     */
    boolean modifySupplier(Supplier supplier) throws Exception;

    /**
     * 获取所有供应商信息
     *
     * @return
     * @throws Exception
     */
    List<Supplier> querySupplierList() throws Exception;

    /**
     * 删除供应商
     *
     * @param id
     * @return
     * @throws Exception
     */
    Integer delSupplierById(@Param("id") String id) throws Exception;
}
